| OLD | NEW |
| 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 #include "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/message_loop/message_loop_proxy.h" | 6 #include "base/message_loop/message_loop_proxy.h" |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "content/child/indexed_db/indexed_db_dispatcher.h" | 8 #include "content/child/indexed_db/indexed_db_dispatcher.h" |
| 9 #include "content/child/indexed_db/webidbcursor_impl.h" | 9 #include "content/child/indexed_db/webidbcursor_impl.h" |
| 10 #include "content/child/thread_safe_sender.h" | 10 #include "content/child/thread_safe_sender.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 bool error_seen_; | 42 bool error_seen_; |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(MockCallbacks); | 44 DISALLOW_COPY_AND_ASSIGN(MockCallbacks); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 class MockDispatcher : public IndexedDBDispatcher { | 47 class MockDispatcher : public IndexedDBDispatcher { |
| 48 public: | 48 public: |
| 49 explicit MockDispatcher(ThreadSafeSender* sender) | 49 explicit MockDispatcher(ThreadSafeSender* sender) |
| 50 : IndexedDBDispatcher(sender) {} | 50 : IndexedDBDispatcher(sender) {} |
| 51 | 51 |
| 52 virtual bool Send(IPC::Message* msg) override { | 52 bool Send(IPC::Message* msg) override { |
| 53 delete msg; | 53 delete msg; |
| 54 return true; | 54 return true; |
| 55 } | 55 } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 DISALLOW_COPY_AND_ASSIGN(MockDispatcher); | 58 DISALLOW_COPY_AND_ASSIGN(MockDispatcher); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace | 61 } // namespace |
| 62 | 62 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 class MockCursor : public WebIDBCursorImpl { | 251 class MockCursor : public WebIDBCursorImpl { |
| 252 public: | 252 public: |
| 253 MockCursor(int32 ipc_cursor_id, | 253 MockCursor(int32 ipc_cursor_id, |
| 254 int64 transaction_id, | 254 int64 transaction_id, |
| 255 ThreadSafeSender* thread_safe_sender) | 255 ThreadSafeSender* thread_safe_sender) |
| 256 : WebIDBCursorImpl(ipc_cursor_id, transaction_id, thread_safe_sender), | 256 : WebIDBCursorImpl(ipc_cursor_id, transaction_id, thread_safe_sender), |
| 257 reset_count_(0) {} | 257 reset_count_(0) {} |
| 258 | 258 |
| 259 // This method is virtual so it can be overridden in unit tests. | 259 // This method is virtual so it can be overridden in unit tests. |
| 260 virtual void ResetPrefetchCache() override { ++reset_count_; } | 260 void ResetPrefetchCache() override { ++reset_count_; } |
| 261 | 261 |
| 262 int reset_count() const { return reset_count_; } | 262 int reset_count() const { return reset_count_; } |
| 263 | 263 |
| 264 private: | 264 private: |
| 265 int reset_count_; | 265 int reset_count_; |
| 266 | 266 |
| 267 DISALLOW_COPY_AND_ASSIGN(MockCursor); | 267 DISALLOW_COPY_AND_ASSIGN(MockCursor); |
| 268 }; | 268 }; |
| 269 | 269 |
| 270 } // namespace | 270 } // namespace |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 cursor1_transaction_id); | 342 cursor1_transaction_id); |
| 343 | 343 |
| 344 EXPECT_EQ(2, cursor1->reset_count()); | 344 EXPECT_EQ(2, cursor1->reset_count()); |
| 345 EXPECT_EQ(0, cursor2->reset_count()); | 345 EXPECT_EQ(0, cursor2->reset_count()); |
| 346 | 346 |
| 347 cursor1.reset(); | 347 cursor1.reset(); |
| 348 cursor2.reset(); | 348 cursor2.reset(); |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace content | 351 } // namespace content |
| OLD | NEW |