Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: Source/web/InspectorFrontendClientImpl.cpp

Issue 33523002: Have Frame::script() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/FrameLoaderClientImpl.cpp ('k') | Source/web/WebBindings.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 InspectorFrontendClientImpl::~InspectorFrontendClientImpl() 56 InspectorFrontendClientImpl::~InspectorFrontendClientImpl()
57 { 57 {
58 if (m_frontendHost) 58 if (m_frontendHost)
59 m_frontendHost->disconnectClient(); 59 m_frontendHost->disconnectClient();
60 m_client = 0; 60 m_client = 0;
61 } 61 }
62 62
63 void InspectorFrontendClientImpl::windowObjectCleared() 63 void InspectorFrontendClientImpl::windowObjectCleared()
64 { 64 {
65 v8::HandleScope handleScope(v8::Isolate::GetCurrent()); 65 v8::HandleScope handleScope(v8::Isolate::GetCurrent());
66 v8::Handle<v8::Context> frameContext = m_frontendPage->mainFrame() ? m_front endPage->mainFrame()->script()->currentWorldContext() : v8::Local<v8::Context>() ; 66 v8::Handle<v8::Context> frameContext = m_frontendPage->mainFrame() ? m_front endPage->mainFrame()->script().currentWorldContext() : v8::Local<v8::Context>();
67 v8::Context::Scope contextScope(frameContext); 67 v8::Context::Scope contextScope(frameContext);
68 68
69 if (m_frontendHost) 69 if (m_frontendHost)
70 m_frontendHost->disconnectClient(); 70 m_frontendHost->disconnectClient();
71 m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage); 71 m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage);
72 v8::Handle<v8::Value> frontendHostObj = toV8(m_frontendHost.get(), v8::Handl e<v8::Object>(), frameContext->GetIsolate()); 72 v8::Handle<v8::Value> frontendHostObj = toV8(m_frontendHost.get(), v8::Handl e<v8::Object>(), frameContext->GetIsolate());
73 v8::Handle<v8::Object> global = frameContext->Global(); 73 v8::Handle<v8::Object> global = frameContext->Global();
74 74
75 global->Set(v8::String::New("InspectorFrontendHost"), frontendHostObj); 75 global->Set(v8::String::New("InspectorFrontendHost"), frontendHostObj);
76 76
77 ScriptController* scriptController = m_frontendPage->mainFrame() ? m_fronten dPage->mainFrame()->script() : 0; 77 ScriptController* scriptController = m_frontendPage->mainFrame() ? &m_fronte ndPage->mainFrame()->script() : 0;
78 if (scriptController) { 78 if (scriptController) {
79 String installLegacyOverrides = 79 String installLegacyOverrides =
80 "" // Support for legacy front-ends (<M31). Do not add items here. 80 "" // Support for legacy front-ends (<M31). Do not add items here.
81 "(function(host, methodNames) {" 81 "(function(host, methodNames) {"
82 " var callId = 0;" 82 " var callId = 0;"
83 " function dispatch(methodName)" 83 " function dispatch(methodName)"
84 " {" 84 " {"
85 " var argsArray = Array.prototype.slice.call(arguments, 1);" 85 " var argsArray = Array.prototype.slice.call(arguments, 1);"
86 " var message = {\"method\": methodName, \"id\": ++callId};" 86 " var message = {\"method\": methodName, \"id\": ++callId};"
87 " if (argsArray.length)" 87 " if (argsArray.length)"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 { 130 {
131 m_client->sendMessageToEmbedder(message); 131 m_client->sendMessageToEmbedder(message);
132 } 132 }
133 133
134 bool InspectorFrontendClientImpl::isUnderTest() 134 bool InspectorFrontendClientImpl::isUnderTest()
135 { 135 {
136 return m_client->isUnderTest(); 136 return m_client->isUnderTest();
137 } 137 }
138 138
139 } // namespace WebKit 139 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/FrameLoaderClientImpl.cpp ('k') | Source/web/WebBindings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698