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

Side by Side Diff: content/browser/database_quota_client_unittest.cc

Issue 637183002: Replace FINAL and OVERRIDE with their C++11 counterparts in content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased the patch 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <map> 5 #include <map>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 20 matching lines...) Expand all
31 // that are used by the QuotaClient. 31 // that are used by the QuotaClient.
32 class MockDatabaseTracker : public DatabaseTracker { 32 class MockDatabaseTracker : public DatabaseTracker {
33 public: 33 public:
34 MockDatabaseTracker() 34 MockDatabaseTracker()
35 : DatabaseTracker(base::FilePath(), false, NULL, NULL, NULL), 35 : DatabaseTracker(base::FilePath(), false, NULL, NULL, NULL),
36 delete_called_count_(0), 36 delete_called_count_(0),
37 async_delete_(false) {} 37 async_delete_(false) {}
38 38
39 virtual bool GetOriginInfo( 39 virtual bool GetOriginInfo(
40 const std::string& origin_identifier, 40 const std::string& origin_identifier,
41 OriginInfo* info) OVERRIDE { 41 OriginInfo* info) override {
42 std::map<GURL, MockOriginInfo>::const_iterator found = 42 std::map<GURL, MockOriginInfo>::const_iterator found =
43 mock_origin_infos_.find( 43 mock_origin_infos_.find(
44 storage::GetOriginFromIdentifier(origin_identifier)); 44 storage::GetOriginFromIdentifier(origin_identifier));
45 if (found == mock_origin_infos_.end()) 45 if (found == mock_origin_infos_.end())
46 return false; 46 return false;
47 *info = OriginInfo(found->second); 47 *info = OriginInfo(found->second);
48 return true; 48 return true;
49 } 49 }
50 50
51 virtual bool GetAllOriginIdentifiers( 51 virtual bool GetAllOriginIdentifiers(
52 std::vector<std::string>* origins_identifiers) OVERRIDE { 52 std::vector<std::string>* origins_identifiers) override {
53 std::map<GURL, MockOriginInfo>::const_iterator iter; 53 std::map<GURL, MockOriginInfo>::const_iterator iter;
54 for (iter = mock_origin_infos_.begin(); 54 for (iter = mock_origin_infos_.begin();
55 iter != mock_origin_infos_.end(); 55 iter != mock_origin_infos_.end();
56 ++iter) { 56 ++iter) {
57 origins_identifiers->push_back(iter->second.GetOriginIdentifier()); 57 origins_identifiers->push_back(iter->second.GetOriginIdentifier());
58 } 58 }
59 return true; 59 return true;
60 } 60 }
61 61
62 virtual bool GetAllOriginsInfo( 62 virtual bool GetAllOriginsInfo(
63 std::vector<OriginInfo>* origins_info) OVERRIDE { 63 std::vector<OriginInfo>* origins_info) override {
64 std::map<GURL, MockOriginInfo>::const_iterator iter; 64 std::map<GURL, MockOriginInfo>::const_iterator iter;
65 for (iter = mock_origin_infos_.begin(); 65 for (iter = mock_origin_infos_.begin();
66 iter != mock_origin_infos_.end(); 66 iter != mock_origin_infos_.end();
67 ++iter) { 67 ++iter) {
68 origins_info->push_back(OriginInfo(iter->second)); 68 origins_info->push_back(OriginInfo(iter->second));
69 } 69 }
70 return true; 70 return true;
71 } 71 }
72 72
73 virtual int DeleteDataForOrigin( 73 virtual int DeleteDataForOrigin(
74 const std::string& origin_identifier, 74 const std::string& origin_identifier,
75 const net::CompletionCallback& callback) OVERRIDE { 75 const net::CompletionCallback& callback) override {
76 ++delete_called_count_; 76 ++delete_called_count_;
77 if (async_delete()) { 77 if (async_delete()) {
78 base::MessageLoopProxy::current()->PostTask( 78 base::MessageLoopProxy::current()->PostTask(
79 FROM_HERE, 79 FROM_HERE,
80 base::Bind(&MockDatabaseTracker::AsyncDeleteDataForOrigin, this, 80 base::Bind(&MockDatabaseTracker::AsyncDeleteDataForOrigin, this,
81 callback)); 81 callback));
82 return net::ERR_IO_PENDING; 82 return net::ERR_IO_PENDING;
83 } 83 }
84 return net::OK; 84 return net::OK;
85 } 85 }
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 mock_tracker()->set_async_delete(false); 276 mock_tracker()->set_async_delete(false);
277 EXPECT_TRUE(DeleteOriginData(&client, kTemp, kOriginA)); 277 EXPECT_TRUE(DeleteOriginData(&client, kTemp, kOriginA));
278 EXPECT_EQ(1, mock_tracker()->delete_called_count()); 278 EXPECT_EQ(1, mock_tracker()->delete_called_count());
279 279
280 mock_tracker()->set_async_delete(true); 280 mock_tracker()->set_async_delete(true);
281 EXPECT_TRUE(DeleteOriginData(&client, kTemp, kOriginA)); 281 EXPECT_TRUE(DeleteOriginData(&client, kTemp, kOriginA));
282 EXPECT_EQ(2, mock_tracker()->delete_called_count()); 282 EXPECT_EQ(2, mock_tracker()->delete_called_count());
283 } 283 }
284 284
285 } // namespace content 285 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/cross_site_transfer_browsertest.cc ('k') | content/browser/database_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698