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

Side by Side Diff: trunk/src/extensions/browser/extension_function.cc

Issue 271863005: Revert 268939 "Pass RenderFrameHost to WebContentObservers' mess..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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 | « trunk/src/content/public/browser/web_contents_observer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "extensions/browser/extension_function.h" 5 #include "extensions/browser/extension_function.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/public/browser/notification_source.h" 8 #include "content/public/browser/notification_source.h"
9 #include "content/public/browser/notification_types.h" 9 #include "content/public/browser/notification_types.h"
10 #include "content/public/browser/render_frame_host.h" 10 #include "content/public/browser/render_frame_host.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 function_->SetRenderViewHost(NULL); 123 function_->SetRenderViewHost(NULL);
124 } 124 }
125 virtual void RenderFrameDeleted( 125 virtual void RenderFrameDeleted(
126 content::RenderFrameHost* render_frame_host) OVERRIDE { 126 content::RenderFrameHost* render_frame_host) OVERRIDE {
127 if (render_frame_host != function_->render_frame_host()) 127 if (render_frame_host != function_->render_frame_host())
128 return; 128 return;
129 129
130 function_->SetRenderFrameHost(NULL); 130 function_->SetRenderFrameHost(NULL);
131 } 131 }
132 132
133 virtual bool OnMessageReceived(
134 const IPC::Message& message,
135 content::RenderFrameHost* render_frame_host) OVERRIDE {
136 DCHECK(render_frame_host);
137 if (render_frame_host == function_->render_frame_host())
138 return function_->OnMessageReceived(message);
139 else
140 return false;
141 }
142
143 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { 133 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
144 return function_->OnMessageReceived(message); 134 return function_->OnMessageReceived(message);
145 } 135 }
146 136
147 UIThreadExtensionFunction* function_; 137 UIThreadExtensionFunction* function_;
148 138
149 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker); 139 DISALLOW_COPY_AND_ASSIGN(RenderHostTracker);
150 }; 140 };
151 141
152 ExtensionFunction::ExtensionFunction() 142 ExtensionFunction::ExtensionFunction()
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { 378 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() {
389 } 379 }
390 380
391 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { 381 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() {
392 } 382 }
393 383
394 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { 384 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() {
395 return RespondNow(RunSync() ? MultipleArguments(results_.get()) 385 return RespondNow(RunSync() ? MultipleArguments(results_.get())
396 : Error(error_)); 386 : Error(error_));
397 } 387 }
OLDNEW
« no previous file with comments | « trunk/src/content/public/browser/web_contents_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698