Skip to content

Commit

Permalink
Merge pull request flutter#2126 from eseidelGoogle/startup_trace
Browse files Browse the repository at this point in the history
Add various trace events for tracing startup
  • Loading branch information
eseidelGoogle committed Dec 2, 2015
2 parents b915f21 + a92597e commit 090d91f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sky/engine/core/script/dart_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ void DartController::DidLoadMainLibrary(String name) {
}

void DartController::DidLoadSnapshot() {
TRACE_EVENT0("flutter", "DartController::DidLoadSnapshot");

DCHECK(Dart_CurrentIsolate() == nullptr);
snapshot_loader_ = nullptr;

Expand Down
1 change: 1 addition & 0 deletions sky/engine/core/script/dart_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ bool IsRunningPrecompiledCode() {
#endif // DART_ALLOW_DYNAMIC_RESOLUTION

void InitDartVM() {
TRACE_EVENT0("flutter", "InitDartVM");
dart::bin::BootstrapDartIo();

bool enable_checked_mode = RuntimeEnabledFeatures::dartCheckedModeEnabled();
Expand Down
3 changes: 3 additions & 0 deletions sky/engine/web/Sky.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "sky/engine/wtf/text/AtomicString.h"
#include "sky/engine/wtf/text/TextEncoding.h"
#include "sky/engine/wtf/WTF.h"
#include "base/trace_event/trace_event.h"

namespace blink {

Expand Down Expand Up @@ -115,6 +116,8 @@ static void cryptographicallyRandomValues(unsigned char* buffer, size_t length)

void initialize(Platform* platform)
{
TRACE_EVENT0("flutter", "blink::initialize");

ASSERT(!s_webKitInitialized);
s_webKitInitialized = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.view.WindowManager;

import org.chromium.base.PathUtils;
import org.chromium.base.TraceEvent;
import org.chromium.mojom.sky.EventType;
import org.chromium.mojom.sky.InputEvent;

Expand Down Expand Up @@ -113,6 +114,8 @@ protected void onPostResume() {
* Override this function to customize startup behavior.
*/
protected void onSkyReady() {
TraceEvent.instant("SkyActivity.onSkyReady");

if (loadIntent(getIntent())) {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions sky/shell/ui/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ void Engine::RunFromLibrary(const std::string& name) {
void Engine::RunFromSnapshotStream(
const std::string& name,
mojo::ScopedDataPipeConsumerHandle snapshot) {
TRACE_EVENT0("flutter", "Engine::RunFromSnapshotStream");

sky_view_ = blink::SkyView::Create(this);
sky_view_->CreateView(blink::WebString::fromUTF8(name));
sky_view_->RunFromSnapshot(blink::WebString::fromUTF8(name), snapshot.Pass());
Expand Down Expand Up @@ -201,6 +203,8 @@ void Engine::RunFromFile(const mojo::String& main,
}

void Engine::RunFromBundle(const mojo::String& path) {
TRACE_EVENT0("flutter", "Engine::RunFromBundle");

AssetUnpackerJob* unpacker = new AssetUnpackerJob(
mojo::GetProxy(&root_bundle_), base::WorkerPool::GetTaskRunner(true));
std::string path_str = path;
Expand Down

0 comments on commit 090d91f

Please sign in to comment.