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

Issue 5950003: Remove CrApplication dependency from base (Closed)

Created:
10 years ago by Nico
Modified:
9 years, 7 months ago
Reviewers:
Mark Mentovai, dmac
CC:
chromium-reviews, Paweł Hajdan Jr., pam+watch_chromium.org, brettw-cc_chromium.org, jam, darin-cc_chromium.org, native-client-reviews_googlegroups.com, stuartmorgan+watch_chromium.org
Visibility:
Public.

Description

Remove CrApplication dependency from base Add a @protocol CrAppProtocol that clients of base must implement in their NSApplication subclass, and let base depend only on this protocol. Let MessagePumpNSApplication::DoRun() no longer initialize NSApplication (fixes a TODO). Add a MockCrApplication that the simple unittests in base and app can use, move chrome_application to chrome/common. Test shell might run nested run loops, so I gave it a real but simplified CrAppProtocol implementation. BUG=62968, 46929 TEST=Everything still works. The PDF plugin prints one fewer warning when loaded. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=69615

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : wip #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 17

Patch Set 11 : '' #

Patch Set 12 : comments #

Patch Set 13 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -47 lines) Patch
M app/animation_container_unittest.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M app/test_suite.h View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -0 lines 0 comments Download
M base/base.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M base/base.gypi View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M base/mac_util_unittest.mm View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M base/message_pump_mac.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +13 lines, -4 lines 0 comments Download
M base/message_pump_mac.mm View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -8 lines 0 comments Download
A base/test/mock_chrome_application_mac.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +28 lines, -0 lines 0 comments Download
A base/test/mock_chrome_application_mac.mm View 1 2 3 4 5 6 7 8 1 chunk +19 lines, -0 lines 0 comments Download
M chrome/browser/chrome_browser_application_mac.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/chrome_browser_application_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/tab_contents/popup_menu_helper_mac.mm View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/tab_contents_view_mac.mm View 1 2 3 4 5 2 chunks +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h View 1 2 3 4 2 chunks +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/cocoa_test_helper.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome_common.gypi View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A + chrome/common/chrome_application_mac.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +6 lines, -7 lines 0 comments Download
A + chrome/common/chrome_application_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +10 lines, -6 lines 0 comments Download
M chrome/common/sandbox_mac.mm View 1 2 3 4 2 chunks +1 line, -1 line 0 comments Download
M chrome/nacl/nacl_main_platform_delegate_mac.mm View 1 2 3 4 5 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/plugin/plugin_main_mac.mm View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/renderer/renderer_main_platform_delegate_mac.mm View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/out_of_proc_test_runner.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +8 lines, -0 lines 0 comments Download
M webkit/tools/test_shell/test_shell_platform_delegate_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +25 lines, -3 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Nico
Most of the files were just touched to change the include from base to chrome/common, ...
10 years ago (2010-12-17 08:08:53 UTC) #1
Nico
(looks like browser_tests also needs to call [CrApplication sharedApplication] somewhere. Should be a 1-line fix ...
10 years ago (2010-12-17 08:11:58 UTC) #2
Mark Mentovai
LGTM http://codereview.chromium.org/5950003/diff/23001/base/message_pump_mac.h File base/message_pump_mac.h (right): http://codereview.chromium.org/5950003/diff/23001/base/message_pump_mac.h#newcode44 base/message_pump_mac.h:44: class NSAutoreleasePool; Since you just #imported AppKit.h, this ...
10 years ago (2010-12-17 17:31:37 UTC) #3
dmac
LGTM http://codereview.chromium.org/5950003/diff/23001/base/message_pump_mac.mm File base/message_pump_mac.mm (left): http://codereview.chromium.org/5950003/diff/23001/base/message_pump_mac.mm#oldcode676 base/message_pump_mac.mm:676: // TODO(dmaclach): Get rid of this gratuitous sharedApplication. ...
10 years ago (2010-12-17 18:00:15 UTC) #4
Nico
It might pass browser_tests now. Will address your comments soon.
10 years ago (2010-12-17 21:46:53 UTC) #5
Nico
10 years ago (2010-12-18 01:14:28 UTC) #6
Thanks, submitting.

http://codereview.chromium.org/5950003/diff/23001/base/message_pump_mac.h
File base/message_pump_mac.h (right):

http://codereview.chromium.org/5950003/diff/23001/base/message_pump_mac.h#new...
base/message_pump_mac.h:44: class NSAutoreleasePool;
On 2010/12/17 17:31:38, Mark Mentovai wrote:
> Since you just #imported AppKit.h, this is unnecessary.

Removed.
 
> (But do you need AppKit.h?)

Yes. (for BOOL)

http://codereview.chromium.org/5950003/diff/23001/base/test/mock_chrome_appli...
File base/test/mock_chrome_application_mac.h (right):

http://codereview.chromium.org/5950003/diff/23001/base/test/mock_chrome_appli...
base/test/mock_chrome_application_mac.h:8: 
On 2010/12/17 17:31:38, Mark Mentovai wrote:
> Extra blank line.

Done.

http://codereview.chromium.org/5950003/diff/23001/base/test/mock_chrome_appli...
base/test/mock_chrome_application_mac.h:10: #ifdef __OBJC__
On 2010/12/17 17:31:38, Mark Mentovai wrote:
> Chromium code prefers #if defined(__OBJC__).

Done.

http://codereview.chromium.org/5950003/diff/23001/base/test/mock_chrome_appli...
base/test/mock_chrome_application_mac.h:12: #import <Cocoa/Cocoa.h>
On 2010/12/17 17:31:38, Mark Mentovai wrote:
> You can get away with just AppKit/AppKit.h.

Done.

http://codereview.chromium.org/5950003/diff/23001/base/test/mock_chrome_appli...
base/test/mock_chrome_application_mac.h:17: // on the stack. This can be used in
tests that need an NSApplication and which
On 2010/12/17 18:00:16, dmac wrote:
> I think you can get rid of both "whichs" in the last sentence.

Done.

http://codereview.chromium.org/5950003/diff/23001/base/test/mock_chrome_appli...
base/test/mock_chrome_application_mac.h:27: }
On 2010/12/17 17:31:38, Mark Mentovai wrote:
> }  // namespace mock_cr_app

Done.

http://codereview.chromium.org/5950003/diff/23001/webkit/tools/test_shell/tes...
File webkit/tools/test_shell/test_shell_platform_delegate_mac.mm (right):

http://codereview.chromium.org/5950003/diff/23001/webkit/tools/test_shell/tes...
webkit/tools/test_shell/test_shell_platform_delegate_mac.mm:27: -
(BOOL)isHandlingSendEvent;
On 2010/12/17 18:00:16, dmac wrote:
> Use a property to mimic what you did in chrome_application_mac? Or get rid of
> the property there?

Done.

http://codereview.chromium.org/5950003/diff/23001/webkit/tools/test_shell/tes...
webkit/tools/test_shell/test_shell_platform_delegate_mac.mm:36: BOOL b =
handlingSendEvent_;
On 2010/12/17 17:31:38, Mark Mentovai wrote:
> What does b signify?
> 
> wasHandlingSendEvent?

Done.

Powered by Google App Engine
This is Rietveld 408576698