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

Side by Side Diff: chrome/renderer/extensions/event_bindings.cc

Issue 8143009: Reland 103263 - Revert 103263 - Merge 101221 - Reland 101111 - Only deliver extension messages to... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/874/src/
Patch Set: Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/renderer/extensions/event_bindings.h" 5 #include "chrome/renderer/extensions/event_bindings.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 385
386 V8ValueConverter converter; 386 V8ValueConverter converter;
387 for (ContextList::iterator it = contexts.begin(); 387 for (ContextList::iterator it = contexts.begin();
388 it != contexts.end(); ++it) { 388 it != contexts.end(); ++it) {
389 if ((*it)->context.IsEmpty()) 389 if ((*it)->context.IsEmpty())
390 continue; 390 continue;
391 391
392 if (!extension_id.empty() && extension_id != (*it)->extension_id) 392 if (!extension_id.empty() && extension_id != (*it)->extension_id)
393 continue; 393 continue;
394 394
395 WebFrame* context_frame = WebFrame::frameForContext((*it)->context); 395 RenderView* context_render_view = (*it)->GetRenderView();
396 if (!context_frame || !context_frame->view())
397 continue;
398
399 RenderView* context_render_view =
400 RenderView::FromWebView(context_frame->view());
401 if (!context_render_view) 396 if (!context_render_view)
402 continue; 397 continue;
403 398
404 if (render_view && render_view != context_render_view) 399 if (render_view && render_view != context_render_view)
405 continue; 400 continue;
406 401
407 if (!HasSufficientPermissions(context_render_view, event_url)) 402 if (!HasSufficientPermissions(context_render_view, event_url))
408 continue; 403 continue;
409 404
410 v8::Local<v8::Context> context(*((*it)->context)); 405 v8::Local<v8::Context> context(*((*it)->context));
(...skipping 11 matching lines...) Expand all
422 // TODO(rafaelw): Consider only doing this check if function_name == 417 // TODO(rafaelw): Consider only doing this check if function_name ==
423 // "Event.dispatchJSON". 418 // "Event.dispatchJSON".
424 #ifndef NDEBUG 419 #ifndef NDEBUG
425 if (!retval.IsEmpty() && !retval->IsUndefined()) { 420 if (!retval.IsEmpty() && !retval->IsUndefined()) {
426 std::string error = *v8::String::AsciiValue(retval); 421 std::string error = *v8::String::AsciiValue(retval);
427 DCHECK(false) << error; 422 DCHECK(false) << error;
428 } 423 }
429 #endif 424 #endif
430 } 425 }
431 } 426 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/bindings_utils.cc ('k') | chrome/renderer/extensions/extension_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698