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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.h

Issue 628773003: Partially convert geolocation IPC to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to reviews, port override impl Created 6 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
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 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "content/browser/accessibility/browser_accessibility_manager.h" 17 #include "content/browser/accessibility/browser_accessibility_manager.h"
18 #include "content/browser/site_instance_impl.h" 18 #include "content/browser/site_instance_impl.h"
19 #include "content/common/accessibility_mode_enums.h" 19 #include "content/common/accessibility_mode_enums.h"
20 #include "content/common/content_export.h" 20 #include "content/common/content_export.h"
21 #include "content/common/mojo/service_registry_impl.h" 21 #include "content/common/mojo/service_registry_impl.h"
22 #include "content/common/render_frame_setup.mojom.h"
22 #include "content/public/browser/render_frame_host.h" 23 #include "content/public/browser/render_frame_host.h"
23 #include "content/public/common/javascript_message_type.h" 24 #include "content/public/common/javascript_message_type.h"
24 #include "net/http/http_response_headers.h" 25 #include "net/http/http_response_headers.h"
25 #include "third_party/WebKit/public/platform/WebNotificationPermission.h" 26 #include "third_party/WebKit/public/platform/WebNotificationPermission.h"
26 #include "third_party/WebKit/public/web/WebTextDirection.h" 27 #include "third_party/WebKit/public/web/WebTextDirection.h"
27 #include "ui/accessibility/ax_node_data.h" 28 #include "ui/accessibility/ax_node_data.h"
28 #include "ui/base/page_transition_types.h" 29 #include "ui/base/page_transition_types.h"
29 30
30 #if defined(OS_ANDROID) 31 #if defined(OS_ANDROID)
31 #include "content/browser/mojo/service_registry_android.h" 32 #include "content/browser/mojo/service_registry_android.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 void OnAccessibilityEvents( 432 void OnAccessibilityEvents(
432 const std::vector<AccessibilityHostMsg_EventParams>& params); 433 const std::vector<AccessibilityHostMsg_EventParams>& params);
433 void OnAccessibilityLocationChanges( 434 void OnAccessibilityLocationChanges(
434 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params); 435 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params);
435 436
436 #if defined(OS_MACOSX) || defined(OS_ANDROID) 437 #if defined(OS_MACOSX) || defined(OS_ANDROID)
437 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params); 438 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params);
438 void OnHidePopup(); 439 void OnHidePopup();
439 #endif 440 #endif
440 441
442 // Registers Mojo services that this frame host makes available.
443 void RegisterMojoServices();
444
441 // Updates the state of this RenderFrameHost and clears any waiting state 445 // Updates the state of this RenderFrameHost and clears any waiting state
442 // that is no longer relevant. 446 // that is no longer relevant.
443 void SetState(RenderFrameHostImplState rfh_state); 447 void SetState(RenderFrameHostImplState rfh_state);
444 448
445 // Returns whether the given URL is allowed to commit in the current process. 449 // Returns whether the given URL is allowed to commit in the current process.
446 // This is a more conservative check than RenderProcessHost::FilterURL, since 450 // This is a more conservative check than RenderProcessHost::FilterURL, since
447 // it will be used to kill processes that commit unauthorized URLs. 451 // it will be used to kill processes that commit unauthorized URLs.
448 bool CanCommitURL(const GURL& url); 452 bool CanCommitURL(const GURL& url);
449 453
450 void PlatformNotificationPermissionRequestDone( 454 void PlatformNotificationPermissionRequestDone(
451 int request_id, blink::WebNotificationPermission permission); 455 int request_id, blink::WebNotificationPermission permission);
452 456
453 // Update the the singleton FrameAccessibility instance with a map 457 // Update the the singleton FrameAccessibility instance with a map
454 // from accessibility node id to the frame routing id of a cross-process 458 // from accessibility node id to the frame routing id of a cross-process
455 // iframe. 459 // iframe.
456 void UpdateCrossProcessIframeAccessibility( 460 void UpdateCrossProcessIframeAccessibility(
457 const std::map<int32, int> node_to_frame_routing_id_map); 461 const std::map<int32, int> node_to_frame_routing_id_map);
458 462
459 // Update the the singleton FrameAccessibility instance with a map 463 // Update the the singleton FrameAccessibility instance with a map
460 // from accessibility node id to the browser plugin instance id of a 464 // from accessibility node id to the browser plugin instance id of a
461 // guest WebContents. 465 // guest WebContents.
462 void UpdateGuestFrameAccessibility( 466 void UpdateGuestFrameAccessibility(
463 const std::map<int32, int> node_to_browser_plugin_instance_id_map); 467 const std::map<int32, int> node_to_browser_plugin_instance_id_map);
464 468
469 // Informs the content client that geolocation permissions were used.
470 void DidUseGeolocationPermission();
471
465 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a 472 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a
466 // refcount that calls Shutdown when it reaches zero. This allows each 473 // refcount that calls Shutdown when it reaches zero. This allows each
467 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring 474 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring
468 // we have a RenderViewHost for each RenderFrameHost. 475 // we have a RenderViewHost for each RenderFrameHost.
469 // TODO(creis): RenderViewHost will eventually go away and be replaced with 476 // TODO(creis): RenderViewHost will eventually go away and be replaced with
470 // some form of page context. 477 // some form of page context.
471 RenderViewHostImpl* render_view_host_; 478 RenderViewHostImpl* render_view_host_;
472 479
473 RenderFrameHostDelegate* delegate_; 480 RenderFrameHostDelegate* delegate_;
474 481
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 568
562 // Callback when an event is received, for testing. 569 // Callback when an event is received, for testing.
563 base::Callback<void(ui::AXEvent, int)> accessibility_testing_callback_; 570 base::Callback<void(ui::AXEvent, int)> accessibility_testing_callback_;
564 // The most recently received accessibility tree - for testing only. 571 // The most recently received accessibility tree - for testing only.
565 scoped_ptr<ui::AXTree> ax_tree_for_testing_; 572 scoped_ptr<ui::AXTree> ax_tree_for_testing_;
566 573
567 // PlzNavigate: Owns the stream used in navigations to store the body of the 574 // PlzNavigate: Owns the stream used in navigations to store the body of the
568 // response once it has started. 575 // response once it has started.
569 scoped_ptr<StreamHandle> stream_handle_; 576 scoped_ptr<StreamHandle> stream_handle_;
570 577
578 // Holds the browser-side handle to the pipe used to establish the Mojo
579 // connection between this instance and its associated render frame.
580 RenderFrameSetupPtr render_frame_setup_;
581
571 // NOTE: This must be the last member. 582 // NOTE: This must be the last member.
572 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; 583 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_;
573 584
574 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); 585 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl);
575 }; 586 };
576 587
577 } // namespace content 588 } // namespace content
578 589
579 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ 590 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698