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

Side by Side Diff: content/child/indexed_db/indexed_db_key_builders.cc

Issue 202863004: Fix "unreachable code" warnings (MSVC warning 4702) in content/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « content/child/child_thread.cc ('k') | content/child/npapi/webplugin_delegate_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/child/indexed_db/indexed_db_key_builders.h" 5 #include "content/child/indexed_db/indexed_db_key_builders.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/WebKit/public/platform/WebVector.h" 8 #include "third_party/WebKit/public/platform/WebVector.h"
9 9
10 using blink::WebIDBKey; 10 using blink::WebIDBKey;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 case WebIDBKeyTypeNumber: 55 case WebIDBKeyTypeNumber:
56 return IndexedDBKey(key.number(), WebIDBKeyTypeNumber); 56 return IndexedDBKey(key.number(), WebIDBKeyTypeNumber);
57 case WebIDBKeyTypeNull: 57 case WebIDBKeyTypeNull:
58 case WebIDBKeyTypeInvalid: 58 case WebIDBKeyTypeInvalid:
59 return IndexedDBKey(key.keyType()); 59 return IndexedDBKey(key.keyType());
60 case WebIDBKeyTypeMin: 60 case WebIDBKeyTypeMin:
61 default: 61 default:
62 NOTREACHED(); 62 NOTREACHED();
63 return IndexedDBKey(); 63 return IndexedDBKey();
64 } 64 }
65 NOTREACHED();
66 return IndexedDBKey();
67 } 65 }
68 66
69 WebIDBKey WebIDBKeyBuilder::Build(const IndexedDBKey& key) { 67 WebIDBKey WebIDBKeyBuilder::Build(const IndexedDBKey& key) {
70 switch (key.type()) { 68 switch (key.type()) {
71 case WebIDBKeyTypeArray: { 69 case WebIDBKeyTypeArray: {
72 const IndexedDBKey::KeyArray& array = key.array(); 70 const IndexedDBKey::KeyArray& array = key.array();
73 blink::WebVector<WebIDBKey> web_array(array.size()); 71 blink::WebVector<WebIDBKey> web_array(array.size());
74 for (size_t i = 0; i < array.size(); ++i) { 72 for (size_t i = 0; i < array.size(); ++i) {
75 web_array[i] = Build(array[i]); 73 web_array[i] = Build(array[i]);
76 } 74 }
77 return WebIDBKey::createArray(web_array); 75 return WebIDBKey::createArray(web_array);
78 } 76 }
79 case WebIDBKeyTypeBinary: 77 case WebIDBKeyTypeBinary:
80 return WebIDBKey::createBinary(key.binary()); 78 return WebIDBKey::createBinary(key.binary());
81 case WebIDBKeyTypeString: 79 case WebIDBKeyTypeString:
82 return WebIDBKey::createString(key.string()); 80 return WebIDBKey::createString(key.string());
83 case WebIDBKeyTypeDate: 81 case WebIDBKeyTypeDate:
84 return WebIDBKey::createDate(key.date()); 82 return WebIDBKey::createDate(key.date());
85 case WebIDBKeyTypeNumber: 83 case WebIDBKeyTypeNumber:
86 return WebIDBKey::createNumber(key.number()); 84 return WebIDBKey::createNumber(key.number());
87 case WebIDBKeyTypeInvalid: 85 case WebIDBKeyTypeInvalid:
88 return WebIDBKey::createInvalid(); 86 return WebIDBKey::createInvalid();
89 case WebIDBKeyTypeNull: 87 case WebIDBKeyTypeNull:
90 return WebIDBKey::createNull(); 88 return WebIDBKey::createNull();
91 case WebIDBKeyTypeMin: 89 case WebIDBKeyTypeMin:
92 default: 90 default:
93 NOTREACHED(); 91 NOTREACHED();
94 return WebIDBKey::createInvalid(); 92 return WebIDBKey::createInvalid();
95 } 93 }
96 NOTREACHED();
97 return WebIDBKey::createInvalid();
98 } 94 }
99 95
100 IndexedDBKeyRange IndexedDBKeyRangeBuilder::Build( 96 IndexedDBKeyRange IndexedDBKeyRangeBuilder::Build(
101 const WebIDBKeyRange& key_range) { 97 const WebIDBKeyRange& key_range) {
102 return IndexedDBKeyRange( 98 return IndexedDBKeyRange(
103 IndexedDBKeyBuilder::Build(key_range.lower()), 99 IndexedDBKeyBuilder::Build(key_range.lower()),
104 IndexedDBKeyBuilder::Build(key_range.upper()), 100 IndexedDBKeyBuilder::Build(key_range.upper()),
105 key_range.lowerOpen(), 101 key_range.lowerOpen(),
106 key_range.upperOpen()); 102 key_range.upperOpen());
107 } 103 }
108 104
109 IndexedDBKeyPath IndexedDBKeyPathBuilder::Build( 105 IndexedDBKeyPath IndexedDBKeyPathBuilder::Build(
110 const blink::WebIDBKeyPath& key_path) { 106 const blink::WebIDBKeyPath& key_path) {
111 switch (key_path.keyPathType()) { 107 switch (key_path.keyPathType()) {
112 case blink::WebIDBKeyPathTypeString: 108 case blink::WebIDBKeyPathTypeString:
113 return IndexedDBKeyPath(key_path.string()); 109 return IndexedDBKeyPath(key_path.string());
114 case blink::WebIDBKeyPathTypeArray: 110 case blink::WebIDBKeyPathTypeArray:
115 return IndexedDBKeyPath(CopyArray(key_path.array())); 111 return IndexedDBKeyPath(CopyArray(key_path.array()));
116 case blink::WebIDBKeyPathTypeNull: 112 case blink::WebIDBKeyPathTypeNull:
117 return IndexedDBKeyPath(); 113 return IndexedDBKeyPath();
114 default:
115 NOTREACHED();
116 return IndexedDBKeyPath();
118 } 117 }
119 NOTREACHED();
120 return IndexedDBKeyPath();
121 } 118 }
122 119
123 blink::WebIDBKeyPath WebIDBKeyPathBuilder::Build( 120 blink::WebIDBKeyPath WebIDBKeyPathBuilder::Build(
124 const IndexedDBKeyPath& key_path) { 121 const IndexedDBKeyPath& key_path) {
125 switch (key_path.type()) { 122 switch (key_path.type()) {
126 case blink::WebIDBKeyPathTypeString: 123 case blink::WebIDBKeyPathTypeString:
127 return blink::WebIDBKeyPath::create(WebString(key_path.string())); 124 return blink::WebIDBKeyPath::create(WebString(key_path.string()));
128 case blink::WebIDBKeyPathTypeArray: 125 case blink::WebIDBKeyPathTypeArray:
129 return blink::WebIDBKeyPath::create(CopyArray(key_path.array())); 126 return blink::WebIDBKeyPath::create(CopyArray(key_path.array()));
130 case blink::WebIDBKeyPathTypeNull: 127 case blink::WebIDBKeyPathTypeNull:
131 return blink::WebIDBKeyPath::createNull(); 128 return blink::WebIDBKeyPath::createNull();
129 default:
130 NOTREACHED();
131 return blink::WebIDBKeyPath::createNull();
132 } 132 }
133 NOTREACHED();
134 return blink::WebIDBKeyPath::createNull();
135 } 133 }
136 134
137 } // namespace content 135 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_thread.cc ('k') | content/child/npapi/webplugin_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698