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

Side by Side Diff: content/browser/web_contents/web_contents_impl.h

Issue 1549113002: Switch to standard integer types in content/browser/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 12 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
7 7
8 #include <stdint.h>
9
8 #include <map> 10 #include <map>
9 #include <set> 11 #include <set>
10 #include <string> 12 #include <string>
11 13
12 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
13 #include "base/containers/scoped_ptr_hash_map.h" 15 #include "base/containers/scoped_ptr_hash_map.h"
14 #include "base/gtest_prod_util.h" 16 #include "base/gtest_prod_util.h"
17 #include "base/macros.h"
15 #include "base/memory/scoped_ptr.h" 18 #include "base/memory/scoped_ptr.h"
16 #include "base/observer_list.h" 19 #include "base/observer_list.h"
17 #include "base/process/process.h" 20 #include "base/process/process.h"
18 #include "base/values.h" 21 #include "base/values.h"
22 #include "build/build_config.h"
19 #include "content/browser/frame_host/frame_tree.h" 23 #include "content/browser/frame_host/frame_tree.h"
20 #include "content/browser/frame_host/navigation_controller_delegate.h" 24 #include "content/browser/frame_host/navigation_controller_delegate.h"
21 #include "content/browser/frame_host/navigation_controller_impl.h" 25 #include "content/browser/frame_host/navigation_controller_impl.h"
22 #include "content/browser/frame_host/navigator_delegate.h" 26 #include "content/browser/frame_host/navigator_delegate.h"
23 #include "content/browser/frame_host/render_frame_host_delegate.h" 27 #include "content/browser/frame_host/render_frame_host_delegate.h"
24 #include "content/browser/frame_host/render_frame_host_manager.h" 28 #include "content/browser/frame_host/render_frame_host_manager.h"
25 #include "content/browser/media/audio_stream_monitor.h" 29 #include "content/browser/media/audio_stream_monitor.h"
26 #include "content/browser/renderer_host/render_view_host_delegate.h" 30 #include "content/browser/renderer_host/render_view_host_delegate.h"
27 #include "content/browser/renderer_host/render_view_host_impl.h" 31 #include "content/browser/renderer_host/render_view_host_impl.h"
28 #include "content/browser/renderer_host/render_widget_host_delegate.h" 32 #include "content/browser/renderer_host/render_widget_host_delegate.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 const std::string& GetUserAgentOverride() const override; 257 const std::string& GetUserAgentOverride() const override;
254 void EnableTreeOnlyAccessibilityMode() override; 258 void EnableTreeOnlyAccessibilityMode() override;
255 bool IsTreeOnlyAccessibilityModeForTesting() const override; 259 bool IsTreeOnlyAccessibilityModeForTesting() const override;
256 bool IsFullAccessibilityModeForTesting() const override; 260 bool IsFullAccessibilityModeForTesting() const override;
257 #if defined(OS_WIN) 261 #if defined(OS_WIN)
258 void SetParentNativeViewAccessible( 262 void SetParentNativeViewAccessible(
259 gfx::NativeViewAccessible accessible_parent) override; 263 gfx::NativeViewAccessible accessible_parent) override;
260 #endif 264 #endif
261 const PageImportanceSignals& GetPageImportanceSignals() const override; 265 const PageImportanceSignals& GetPageImportanceSignals() const override;
262 const base::string16& GetTitle() const override; 266 const base::string16& GetTitle() const override;
263 int32 GetMaxPageID() override; 267 int32_t GetMaxPageID() override;
264 int32 GetMaxPageIDForSiteInstance(SiteInstance* site_instance) override; 268 int32_t GetMaxPageIDForSiteInstance(SiteInstance* site_instance) override;
265 SiteInstanceImpl* GetSiteInstance() const override; 269 SiteInstanceImpl* GetSiteInstance() const override;
266 SiteInstanceImpl* GetPendingSiteInstance() const override; 270 SiteInstanceImpl* GetPendingSiteInstance() const override;
267 bool IsLoading() const override; 271 bool IsLoading() const override;
268 bool IsLoadingToDifferentDocument() const override; 272 bool IsLoadingToDifferentDocument() const override;
269 bool IsWaitingForResponse() const override; 273 bool IsWaitingForResponse() const override;
270 const net::LoadStateWithParam& GetLoadState() const override; 274 const net::LoadStateWithParam& GetLoadState() const override;
271 const base::string16& GetLoadStateHost() const override; 275 const base::string16& GetLoadStateHost() const override;
272 uint64 GetUploadSize() const override; 276 uint64_t GetUploadSize() const override;
273 uint64 GetUploadPosition() const override; 277 uint64_t GetUploadPosition() const override;
274 const std::string& GetEncoding() const override; 278 const std::string& GetEncoding() const override;
275 bool DisplayedInsecureContent() const override; 279 bool DisplayedInsecureContent() const override;
276 void IncrementCapturerCount(const gfx::Size& capture_size) override; 280 void IncrementCapturerCount(const gfx::Size& capture_size) override;
277 void DecrementCapturerCount() override; 281 void DecrementCapturerCount() override;
278 int GetCapturerCount() const override; 282 int GetCapturerCount() const override;
279 bool IsAudioMuted() const override; 283 bool IsAudioMuted() const override;
280 void SetAudioMuted(bool mute) override; 284 void SetAudioMuted(bool mute) override;
281 bool IsCrashed() const override; 285 bool IsCrashed() const override;
282 void SetIsCrashed(base::TerminationStatus status, int error_code) override; 286 void SetIsCrashed(base::TerminationStatus status, int error_code) override;
283 base::TerminationStatus GetCrashedStatus() const override; 287 base::TerminationStatus GetCrashedStatus() const override;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 bool IsSavable() override; 332 bool IsSavable() override;
329 void OnSavePage() override; 333 void OnSavePage() override;
330 bool SavePage(const base::FilePath& main_file, 334 bool SavePage(const base::FilePath& main_file,
331 const base::FilePath& dir_path, 335 const base::FilePath& dir_path,
332 SavePageType save_type) override; 336 SavePageType save_type) override;
333 void SaveFrame(const GURL& url, const Referrer& referrer) override; 337 void SaveFrame(const GURL& url, const Referrer& referrer) override;
334 void SaveFrameWithHeaders(const GURL& url, 338 void SaveFrameWithHeaders(const GURL& url,
335 const Referrer& referrer, 339 const Referrer& referrer,
336 const std::string& headers) override; 340 const std::string& headers) override;
337 void GenerateMHTML(const base::FilePath& file, 341 void GenerateMHTML(const base::FilePath& file,
338 const base::Callback<void(int64)>& callback) override; 342 const base::Callback<void(int64_t)>& callback) override;
339 const std::string& GetContentsMimeType() const override; 343 const std::string& GetContentsMimeType() const override;
340 bool WillNotifyDisconnection() const override; 344 bool WillNotifyDisconnection() const override;
341 void SetOverrideEncoding(const std::string& encoding) override; 345 void SetOverrideEncoding(const std::string& encoding) override;
342 void ResetOverrideEncoding() override; 346 void ResetOverrideEncoding() override;
343 RendererPreferences* GetMutableRendererPrefs() override; 347 RendererPreferences* GetMutableRendererPrefs() override;
344 void Close() override; 348 void Close() override;
345 void SystemDragEnded() override; 349 void SystemDragEnded() override;
346 void UserGestureDone() override; 350 void UserGestureDone() override;
347 void SetClosedByUserGesture(bool value) override; 351 void SetClosedByUserGesture(bool value) override;
348 bool GetClosedByUserGesture() const override; 352 bool GetClosedByUserGesture() const override;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 const base::string16& message, 416 const base::string16& message,
413 bool is_reload, 417 bool is_reload,
414 IPC::Message* reply_msg) override; 418 IPC::Message* reply_msg) override;
415 void DidAccessInitialDocument() override; 419 void DidAccessInitialDocument() override;
416 void DidChangeName(RenderFrameHost* render_frame_host, 420 void DidChangeName(RenderFrameHost* render_frame_host,
417 const std::string& name) override; 421 const std::string& name) override;
418 void DocumentOnLoadCompleted(RenderFrameHost* render_frame_host) override; 422 void DocumentOnLoadCompleted(RenderFrameHost* render_frame_host) override;
419 void UpdateStateForFrame(RenderFrameHost* render_frame_host, 423 void UpdateStateForFrame(RenderFrameHost* render_frame_host,
420 const PageState& page_state) override; 424 const PageState& page_state) override;
421 void UpdateTitle(RenderFrameHost* render_frame_host, 425 void UpdateTitle(RenderFrameHost* render_frame_host,
422 int32 page_id, 426 int32_t page_id,
423 const base::string16& title, 427 const base::string16& title,
424 base::i18n::TextDirection title_direction) override; 428 base::i18n::TextDirection title_direction) override;
425 void UpdateEncoding(RenderFrameHost* render_frame_host, 429 void UpdateEncoding(RenderFrameHost* render_frame_host,
426 const std::string& encoding) override; 430 const std::string& encoding) override;
427 WebContents* GetAsWebContents() override; 431 WebContents* GetAsWebContents() override;
428 bool IsNeverVisible() override; 432 bool IsNeverVisible() override;
429 AccessibilityMode GetAccessibilityMode() const override; 433 AccessibilityMode GetAccessibilityMode() const override;
430 void AccessibilityEventReceived( 434 void AccessibilityEventReceived(
431 const std::vector<AXEventNotificationDetails>& details) override; 435 const std::vector<AXEventNotificationDetails>& details) override;
432 RenderFrameHost* GetGuestByInstanceID( 436 RenderFrameHost* GetGuestByInstanceID(
(...skipping 19 matching lines...) Expand all
452 // RenderFrameHostDelegate has the same method, so list it there because this 456 // RenderFrameHostDelegate has the same method, so list it there because this
453 // interface is going away. 457 // interface is going away.
454 // WebContents* GetAsWebContents() override; 458 // WebContents* GetAsWebContents() override;
455 void RenderViewCreated(RenderViewHost* render_view_host) override; 459 void RenderViewCreated(RenderViewHost* render_view_host) override;
456 void RenderViewReady(RenderViewHost* render_view_host) override; 460 void RenderViewReady(RenderViewHost* render_view_host) override;
457 void RenderViewTerminated(RenderViewHost* render_view_host, 461 void RenderViewTerminated(RenderViewHost* render_view_host,
458 base::TerminationStatus status, 462 base::TerminationStatus status,
459 int error_code) override; 463 int error_code) override;
460 void RenderViewDeleted(RenderViewHost* render_view_host) override; 464 void RenderViewDeleted(RenderViewHost* render_view_host) override;
461 void UpdateState(RenderViewHost* render_view_host, 465 void UpdateState(RenderViewHost* render_view_host,
462 int32 page_id, 466 int32_t page_id,
463 const PageState& page_state) override; 467 const PageState& page_state) override;
464 void UpdateTargetURL(RenderViewHost* render_view_host, 468 void UpdateTargetURL(RenderViewHost* render_view_host,
465 const GURL& url) override; 469 const GURL& url) override;
466 void Close(RenderViewHost* render_view_host) override; 470 void Close(RenderViewHost* render_view_host) override;
467 void RequestMove(const gfx::Rect& new_bounds) override; 471 void RequestMove(const gfx::Rect& new_bounds) override;
468 void DidCancelLoading() override; 472 void DidCancelLoading() override;
469 void DocumentAvailableInMainFrame(RenderViewHost* render_view_host) override; 473 void DocumentAvailableInMainFrame(RenderViewHost* render_view_host) override;
470 void RouteCloseEvent(RenderViewHost* rvh) override; 474 void RouteCloseEvent(RenderViewHost* rvh) override;
471 bool AddMessageToConsole(int32 level, 475 bool AddMessageToConsole(int32_t level,
472 const base::string16& message, 476 const base::string16& message,
473 int32 line_no, 477 int32_t line_no,
474 const base::string16& source_id) override; 478 const base::string16& source_id) override;
475 RendererPreferences GetRendererPrefs( 479 RendererPreferences GetRendererPrefs(
476 BrowserContext* browser_context) const override; 480 BrowserContext* browser_context) const override;
477 void OnUserInteraction(const blink::WebInputEvent::Type type) override; 481 void OnUserInteraction(const blink::WebInputEvent::Type type) override;
478 void OnIgnoredUIEvent() override; 482 void OnIgnoredUIEvent() override;
479 void LoadStateChanged(const GURL& url, 483 void LoadStateChanged(const GURL& url,
480 const net::LoadStateWithParam& load_state, 484 const net::LoadStateWithParam& load_state,
481 uint64 upload_position, 485 uint64_t upload_position,
482 uint64 upload_size) override; 486 uint64_t upload_size) override;
483 void Activate() override; 487 void Activate() override;
484 void RunFileChooser(RenderViewHost* render_view_host, 488 void RunFileChooser(RenderViewHost* render_view_host,
485 const FileChooserParams& params) override; 489 const FileChooserParams& params) override;
486 void UpdatePreferredSize(const gfx::Size& pref_size) override; 490 void UpdatePreferredSize(const gfx::Size& pref_size) override;
487 void CreateNewWindow( 491 void CreateNewWindow(
488 SiteInstance* source_site_instance, 492 SiteInstance* source_site_instance,
489 int32_t route_id, 493 int32_t route_id,
490 int32_t main_frame_route_id, 494 int32_t main_frame_route_id,
491 int32_t main_frame_widget_route_id, 495 int32_t main_frame_widget_route_id,
492 const ViewHostMsg_CreateWindow_Params& params, 496 const ViewHostMsg_CreateWindow_Params& params,
493 SessionStorageNamespace* session_storage_namespace) override; 497 SessionStorageNamespace* session_storage_namespace) override;
494 void CreateNewWidget(int32 render_process_id, 498 void CreateNewWidget(int32_t render_process_id,
495 int32 route_id, 499 int32_t route_id,
496 blink::WebPopupType popup_type) override; 500 blink::WebPopupType popup_type) override;
497 void CreateNewFullscreenWidget(int32 render_process_id, 501 void CreateNewFullscreenWidget(int32_t render_process_id,
498 int32 route_id) override; 502 int32_t route_id) override;
499 void ShowCreatedWindow(int route_id, 503 void ShowCreatedWindow(int route_id,
500 WindowOpenDisposition disposition, 504 WindowOpenDisposition disposition,
501 const gfx::Rect& initial_rect, 505 const gfx::Rect& initial_rect,
502 bool user_gesture) override; 506 bool user_gesture) override;
503 void ShowCreatedWidget(int route_id, const gfx::Rect& initial_rect) override; 507 void ShowCreatedWidget(int route_id, const gfx::Rect& initial_rect) override;
504 void ShowCreatedFullscreenWidget(int route_id) override; 508 void ShowCreatedFullscreenWidget(int route_id) override;
505 void RequestMediaAccessPermission( 509 void RequestMediaAccessPermission(
506 const MediaStreamRequest& request, 510 const MediaStreamRequest& request,
507 const MediaResponseCallback& callback) override; 511 const MediaResponseCallback& callback) override;
508 bool CheckMediaAccessPermission(const GURL& security_origin, 512 bool CheckMediaAccessPermission(const GURL& security_origin,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 // Activate this WebContents and show a form repost warning. 667 // Activate this WebContents and show a form repost warning.
664 void ActivateAndShowRepostFormWarningDialog() override; 668 void ActivateAndShowRepostFormWarningDialog() override;
665 669
666 // Whether the initial empty page of this view has been accessed by another 670 // Whether the initial empty page of this view has been accessed by another
667 // page, making it unsafe to show the pending URL. Always false after the 671 // page, making it unsafe to show the pending URL. Always false after the
668 // first commit. 672 // first commit.
669 bool HasAccessedInitialDocument() override; 673 bool HasAccessedInitialDocument() override;
670 674
671 // Updates the max page ID for the current SiteInstance in this 675 // Updates the max page ID for the current SiteInstance in this
672 // WebContentsImpl to be at least |page_id|. 676 // WebContentsImpl to be at least |page_id|.
673 void UpdateMaxPageID(int32 page_id) override; 677 void UpdateMaxPageID(int32_t page_id) override;
674 678
675 // Updates the max page ID for the given SiteInstance in this WebContentsImpl 679 // Updates the max page ID for the given SiteInstance in this WebContentsImpl
676 // to be at least |page_id|. 680 // to be at least |page_id|.
677 void UpdateMaxPageIDForSiteInstance(SiteInstance* site_instance, 681 void UpdateMaxPageIDForSiteInstance(SiteInstance* site_instance,
678 int32 page_id) override; 682 int32_t page_id) override;
679 683
680 // Copy the current map of SiteInstance ID to max page ID from another tab. 684 // Copy the current map of SiteInstance ID to max page ID from another tab.
681 // This is necessary when this tab adopts the NavigationEntries from 685 // This is necessary when this tab adopts the NavigationEntries from
682 // |web_contents|. 686 // |web_contents|.
683 void CopyMaxPageIDsFrom(WebContents* web_contents) override; 687 void CopyMaxPageIDsFrom(WebContents* web_contents) override;
684 688
685 // Sets the history for this WebContentsImpl to |history_length| entries, with 689 // Sets the history for this WebContentsImpl to |history_length| entries, with
686 // an offset of |history_offset|. 690 // an offset of |history_offset|.
687 void SetHistoryOffsetAndLength(int history_offset, 691 void SetHistoryOffsetAndLength(int history_offset,
688 int history_length) override; 692 int history_length) override;
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 // titles for file URLs that have none (so we require that the URL of the 940 // titles for file URLs that have none (so we require that the URL of the
937 // entry already be set). 941 // entry already be set).
938 // 942 //
939 // This is used as the backend for state updates, which include a new title, 943 // This is used as the backend for state updates, which include a new title,
940 // or the dedicated set title message. It returns true if the new title is 944 // or the dedicated set title message. It returns true if the new title is
941 // different and was therefore updated. 945 // different and was therefore updated.
942 bool UpdateTitleForEntry(NavigationEntryImpl* entry, 946 bool UpdateTitleForEntry(NavigationEntryImpl* entry,
943 const base::string16& title); 947 const base::string16& title);
944 948
945 // Helper for CreateNewWidget/CreateNewFullscreenWidget. 949 // Helper for CreateNewWidget/CreateNewFullscreenWidget.
946 void CreateNewWidget(int32 render_process_id, 950 void CreateNewWidget(int32_t render_process_id,
947 int32 route_id, 951 int32_t route_id,
948 bool is_fullscreen, 952 bool is_fullscreen,
949 blink::WebPopupType popup_type); 953 blink::WebPopupType popup_type);
950 954
951 // Helper for ShowCreatedWidget/ShowCreatedFullscreenWidget. 955 // Helper for ShowCreatedWidget/ShowCreatedFullscreenWidget.
952 void ShowCreatedWidget(int route_id, 956 void ShowCreatedWidget(int route_id,
953 bool is_fullscreen, 957 bool is_fullscreen,
954 const gfx::Rect& initial_rect); 958 const gfx::Rect& initial_rect);
955 959
956 // Finds the new RenderWidgetHost and returns it. Note that this can only be 960 // Finds the new RenderWidgetHost and returns it. Note that this can only be
957 // called once as this call also removes it from the internal map. 961 // called once as this call also removes it from the internal map.
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 int crashed_error_code_; 1081 int crashed_error_code_;
1078 1082
1079 // Whether this WebContents is waiting for a first-response for the 1083 // Whether this WebContents is waiting for a first-response for the
1080 // main resource of the page. This controls whether the throbber state is 1084 // main resource of the page. This controls whether the throbber state is
1081 // "waiting" or "loading." 1085 // "waiting" or "loading."
1082 bool waiting_for_response_; 1086 bool waiting_for_response_;
1083 1087
1084 // Map of SiteInstance ID to max page ID for this tab. A page ID is specific 1088 // Map of SiteInstance ID to max page ID for this tab. A page ID is specific
1085 // to a given tab and SiteInstance, and must be valid for the lifetime of the 1089 // to a given tab and SiteInstance, and must be valid for the lifetime of the
1086 // WebContentsImpl. 1090 // WebContentsImpl.
1087 std::map<int32, int32> max_page_ids_; 1091 std::map<int32_t, int32_t> max_page_ids_;
1088 1092
1089 // The current load state and the URL associated with it. 1093 // The current load state and the URL associated with it.
1090 net::LoadStateWithParam load_state_; 1094 net::LoadStateWithParam load_state_;
1091 base::string16 load_state_host_; 1095 base::string16 load_state_host_;
1092 1096
1093 base::TimeTicks loading_last_progress_update_; 1097 base::TimeTicks loading_last_progress_update_;
1094 1098
1095 // Upload progress, for displaying in the status bar. 1099 // Upload progress, for displaying in the status bar.
1096 // Set to zero when there is no significant upload happening. 1100 // Set to zero when there is no significant upload happening.
1097 uint64 upload_size_; 1101 uint64_t upload_size_;
1098 uint64 upload_position_; 1102 uint64_t upload_position_;
1099 1103
1100 // Tracks that this WebContents needs to unblock requests to the renderer. 1104 // Tracks that this WebContents needs to unblock requests to the renderer.
1101 // See ResumeLoadingCreatedWebContents. 1105 // See ResumeLoadingCreatedWebContents.
1102 bool is_resume_pending_; 1106 bool is_resume_pending_;
1103 1107
1104 // Data for current page ----------------------------------------------------- 1108 // Data for current page -----------------------------------------------------
1105 1109
1106 // When a title cannot be taken from any entry, this title will be used. 1110 // When a title cannot be taken from any entry, this title will be used.
1107 base::string16 page_title_when_no_navigation_entry_; 1111 base::string16 page_title_when_no_navigation_entry_;
1108 1112
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 // Adds/removes a callback called on creation of each new WebContents. 1316 // Adds/removes a callback called on creation of each new WebContents.
1313 static void AddCreatedCallbackForTesting(const CreatedCallback& callback); 1317 static void AddCreatedCallbackForTesting(const CreatedCallback& callback);
1314 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback); 1318 static void RemoveCreatedCallbackForTesting(const CreatedCallback& callback);
1315 1319
1316 DISALLOW_COPY_AND_ASSIGN(FriendZone); 1320 DISALLOW_COPY_AND_ASSIGN(FriendZone);
1317 }; 1321 };
1318 1322
1319 } // namespace content 1323 } // namespace content
1320 1324
1321 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 1325 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_android.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698